<script setup>

    // let div1 = document.getElementById("div1");
    // function switchColor() {
    //     let color = div1.style.backgroundColor;
    //     div1.style.backgroundColor = "yellow";
    //     setTimeout(()=> {div1.style.backgroundColor = color;}, 1000);
    // }

    function clickOnce() {
        alert("你就知道");
    }

    function check(event) {
        let flag =  confirm("确定要访问吗？");
        if (!flag) event.preventDefault();
        
    }
</script>

<template>
    <!-- <div id="div1" class="div1" @click="switchColor()">
        点击
    </div> -->
    <div>
        <button @click.once="clickOnce()">点击一下</button>
        <br>
        <a href="https://kotoriforest.us.kg" @click="check($event)">我的网站</a>
    </div>
</template>

<style scoped>
    /* .div1{
        background-color: red;
        width: 500px;
        height: 500px;
    } */
</style>
